<layout name="layout" />

<!-- 搜索 -->
<div class="form-div search_form_div">
    <form action="__ACTION__" method="GET" name="search_form" class="form-inline">
		<!-- 支付状态 -->
		<div class="form-group">
			<label>支付状态：</label>
			<select name="pay_status" class="form-control">
				<option value="0">全部</option>
				<option <if condition="$Think.get.pay_status eq 'Y'">selected</if> value="Y">已支付</option>
				<option <if condition="$Think.get.pay_status eq 'N'">selected</if> value="N">未支付</option>
			</select>
		</div>
		&nbsp;
		<!-- 发货状态 -->
		<div class="form-group">
			<label>发货状态：</label>
			<select name="post_status" class="form-control">
				<option value="0">全部</option>
				<option <if condition="$Think.get.post_status eq '-1'">selected</if> value="-1">未发货</option>
				<option <if condition="$Think.get.post_status eq '1'">selected</if> value="1">已发货</option>
				<option <if condition="$Think.get.post_status eq '2'">selected</if> value="2">已签收</option>
			</select>
		</div>
		<br/><br/>
		<!-- 订单总价 -->
		<div class="form-group">
			<label>订单总价：</label><input class="form-control" type="text" name="min_price" size="8" placeholder=" 最低价" value="{$Think.get.min_price}"/>
			<label>- 到 -</label> <input class="form-control" type="text" name="max_price" size="8" placeholder=" 最高价" value="{$Think.get.max_price}"/>
		</div>
		<br/><br/>
		<!-- 下单时间 -->
		<div class="form-group">
			<label>下单时间：</label><input class="form-control" type="text" id="o_fa" name="o_fa" size="16" value="{$Think.get.o_fa}" placeholder="    开始时间"/>
			<label>- 到 -</label> <input class="form-control" type="text" id="o_ta" name="o_ta" size="16" value="{$Think.get.o_ta}" placeholder="    结束时间"/>
		</div>
		<br/><br/>
		<!-- 支付时间 -->
		<div class="form-group">
			<label>支付时间：</label><input class="form-control" type="text" id="p_fa" name="p_fa" size="16" value="{$Think.get.p_fa}" placeholder="    开始时间"/>
			<label>- 到 -</label> <input class="form-control" type="text" id="p_ta" name="p_ta" size="16" value="{$Think.get.p_ta}" placeholder="    结束时间"/>
		</div>
		<br/><br/>
		<!-- 收货人 -->
		<div class="form-group">
			<label>收货人姓名：</label><input class="form-control" type="text" name="shr_name" size="16" value="{$Think.get.shr_name}" placeholder=" 请输入收货人姓名"/>
			&nbsp;<label>电话：</label><input class="form-control" type="text" name="shr_tel" size="16" value="{$Think.get.shr_tel}" placeholder=" 请输入收货人电话"/>
		</div>
		<br/><br/>
		<!-- 快递单号 -->
		<div class="form-group">
			<label>快递单号：</label><input class="form-control" type="text" name="post_number" size="16" value="{$Think.get.post_number}" placeholder=" 请输入快递单号"/>
		</div>
		<br/><br/>
		<div class="form-group">
			<label></label>
			<input type="submit" value=" 搜索 " class="btn btn-primary" />
			<a href="__ACTION__" class="btn btn-default" style="margin-left: 12px;">清除搜索</a>
		</div>
    </form>
</div>
<!-- 列表 -->
<div class="list-div" id="listDiv">
    <table cellpadding="3" cellspacing="1">
		<thead style="background-color: skyblue;">
			<tr>
				<th >订单号</th>
				<th >下单时间</th>
				<th >收货人</th>
				<th >总金额</th>
				<th >快递单号</th>
				<th >订单状态</th>
				<th>操作</th>
			</tr>
		</thead>
    	<tbody>
			<?php foreach ($data as $k => $v): ?>
			<tr class="tron">
				<td><?php echo $v['order_sn']; ?></td>
				<td><?php echo date('Y-m-d H:i:s', $v['addtime']); ?></td>
				<td>
					<p><?php echo $v['shr_name']; ?> [TEL:<?php echo $v['shr_tel'];?>]</p>
					<p><?php echo $v['shr_province'];?> <?php echo $v['shr_city'];?> <?php echo $v['shr_area'];?> <?php echo $v['shr_address'];?></p>
				</td>
				<td>￥<?php echo $v['total_price']; ?>元</td>
				<td><?php if($v['post_number']): ?><?php echo $v['post_number'];?><?php else:?>无<?php endif;?></td>
				<td>
                    <?php if($v['order_status']=='正常'):?>
                        <?php if($v['pay_status']=='是'):?>
                            已付款 - <?php echo $v['post_status'] == 0 ? '未发货' : ($v['post_status'] == 1 ? '已发货' : '已签收'); ?>
                        <?php else:?>
                            未付款
                        <?php endif;?>
                    <?php else:?>
                        已关闭
                    <?php endif;?>
				</td>
				<td>
					<a class="btn btn-xs btn-primary" href="<?php echo U('edit',array('order_id'=>$v['id'],'p'=>I('get.p')));?>" title="查看">查看</a>
                    <?php if($v['order_status']=='关闭'):?>
					<a class="btn btn-xs btn-danger" href="<?php echo U('delete',array('id'=>$v['id'],'p'=>I('get.p')));?>" onclick="return confirm('确定要删除吗？');"
                       title="移除">移除</a>
				    <?php endif;?>
                </td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
	<!-- 分页开始 -->
	<table id="page-table" cellspacing="0" style="margin-top: 10px;">
		<tr>
			<td width="70%">&nbsp;</td>
			<td align="center" nowrap="true">
				<nav aria-label="Page navigation">
					<ul class="pagination">
						<li>
							{$page}
						</li>
					</ul>
				</nav>
			</td>
		</tr>
	</table>
	<!-- 分页结束 -->
</div>

<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
<script type="text/javascript">
	$.timepicker.setDefaults($.timepicker.regional['zh-CN']);  // 设置使用中文
	$("#o_fa").datetimepicker();
	$("#o_ta").datetimepicker();
	$("#p_fa").datetimepicker();
	$("#p_ta").datetimepicker();
	$("#search_clean").click(function(){
		window.location.href="{:U( 'Goods/lst' )}";
	});
</script>
<script type="text/javascript" src="__PUBLIC__/Admin/Js/tron.js"></script>